package com.zzh.demo.core.exception;


import com.zzh.demo.core.enumeration.ErrorEnums;

/**
 * description: <br>
 * createTime: 2019/2/149:14 <br>
 *
 * @author zzh
 */
public class BusinessException extends RuntimeException {

    int code;

    String msg;


    public BusinessException(ErrorEnums errorEnum) {
        this.code = errorEnum.getCode();
        this.msg = errorEnum.getTip();
    }

    public BusinessException(ErrorEnums errorEnum, String name) {
        this.code = errorEnum.getCode();
        this.msg = errorEnum.getTip(name);
    }


    public BusinessException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public int getCode() {
        return code;
    }


    public String getMsg() {
        return msg;
    }
}
